package pers.zc.activiti.reqeust.controller;

import lombok.Data;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;

/**
 * @description 测试sessionid
 * @Author Lin FuYuan
 * @date 2020/6/15
 */
@RestController
@RequestMapping("/session")
public class SessionsController {
    @GetMapping("getId")
    public void getSessionId(HttpServletRequest request) {
        String id = request.getRequestedSessionId();
        System.out.println(id);
    }


    public static void main(String[] args) {
        List<Demo> list = new ArrayList<>();
        list.add(new Demo());
        list.add(new Demo());
        list.add(new Demo());
        list.add(new Demo());
        list.add(new Demo());
        list.add(new Demo());


        list.forEach(o -> {
           o.setName("1");
           o.setValue("2");
        });
        System.out.println(list);

    }

    @Data
    static class Demo {
        private String name;
        private String value;
    }


}
